/*
自己选择的路 ,跪着也要走完。朋友们 , 虽然这个世界日益浮躁起来,只
要能够为了当时纯粹的梦想和感动坚持努力下去 , 不管其它人怎么样,我
们也能够保持自己的本色走下去。
To the world , you will be a person , but to a person , you
will be the world .                               ——AKPower
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
const ll maxn = 2e5 + 100;
struct node
{
    ll y, next_s;
} e[maxn];
ll low[maxn], dfn[maxn], dfn_cnt;
ll head[maxn], cnt;
bool vis[maxn];
bool iscut[maxn];
ll ans;
void init()
{
    memset(head, -1, sizeof(head));
    cnt = 0;
}

void add(ll x, ll y)
{
    e[cnt].y = y;
    e[cnt].next_s = head[x];
    head[x] = cnt++;
    return;
}

ll tarjan(ll u, ll fa)
{
    dfn[u] = low[u] = ++dfn_cnt;
    ll child = 0;
    vis[u] = true;
    for (ll i = head[u]; i != -1; i = e[i].next_s)
    {
        ll v = e[i].y;
        if (!dfn[v])
        {
            child++;
            ll dx = tarjan(v, u);
            low[u] = min(low[u], low[v]);
            if (low[v] >= dfn[u])
            {
                // ans++;
                iscut[u] = true;
            }
        }
        else if (dfn[v] < dfn[u] && v != fa)
        {
            low[u] = min(low[u], dfn[v]);
        }
    }
    if (fa < 0 && child == 1)
    {
        iscut[u] = false;
        // ans++;
    }
    return low[u];
}

int main()
{
    IOS;
    init();
    ll n, m;
    cin >> n >> m;
    ll x, y;
    for (ll i = 0; i < m; i++)
    {
        cin >> x >> y;
        add(x, y);
        add(y, x);
    }
    for (ll i = 1; i <= n; i++)
    {
        if (!vis[i])
        {
            memset(dfn, 0, sizeof(dfn));
            tarjan(i, -1);
        }
    }
    for (ll i = 1; i <= n; i++)
    {
        if (iscut[i])
            ans++;
    }
    cout << ans << endl;
    for (ll i = 1; i <= n; i++)
    {
        if (iscut[i])
        {
            if (ans == 1)
            {
                cout << i << endl;
                break;
            }
            else
            {
                ans--;
                cout << i << " ";
            }
        }
    }
    getchar();
    getchar();
    return 0;
}
